<template>
  <div>
    <TbTitle title="一、基本信息" />
    <TbTitle level="2" title="（一）、基础信息" />
    <table border="0" class="m-table-pdf">
      <tr>
        <td class="td-head">名 称</td>
        <td colspan="3"><span>{{ detailInfo.organizationBaseName }}</span></td>
        <td>单位性质</td>
        <td colspan="3"><span>{{ dictToVal(dict1, detailInfo.unitNature) }}</span></td>
      </tr>
      <tr>
        <td class="td-head">业务主管单位</td>
        <td colspan="3"><span>{{ detailInfo.supervisoryUnit }}</span></td>
        <td>对外公开电话</td>
        <td colspan="3"><span>{{ detailInfo.supervisoryPhone }}</span></td>
      </tr>
      <tr>
        <td class="td-head">业务范围</td>
        <td colspan="8"><span>{{ detailInfo.businessScope }}</span></td>
      </tr>
      <tr>
        <td class="td-head">登记证号</td>
        <td><span>{{ detailInfo.registerNum }}</span></td>
        <td>统一社会信用代码</td>
        <td colspan="2"><span>{{ detailInfo.creditCode }}</span></td>
        <td>执业许可证号</td>
        <td colspan="2"><span>{{ detailInfo.practicingLicenseNum }}</span></td>
      </tr>
      <tr>
        <td class="td-head">成立时间</td>
        <td colspan="2"><span>{{ detailInfo.establishTime }}</span></td>
        <td>注册资金</td>
        <td colspan="4"><span>{{ detailInfo.registerCapital }}</span>
          万元
        </td>
      </tr>
      <tr>
        <td class="td-head">邮政编码</td>
        <td colspan="3"><span>{{ detailInfo.postalCode }}</span></td>
        <td>住所来源</td>
        <td colspan="3"><span>{{ dictToVal(dict2, detailInfo.addressSource) }}</span></td>
      </tr>
      <tr>
        <td class="td-head">住 所</td>
        <td colspan="3"><span>{{ detailInfo.registerAddress }}</span></td>
        <td>住所所在区县</td>
        <td colspan="3"><span>{{ dictToVal(dict3, detailInfo.addressCounty) }}</span></td>
      </tr>
      <tr>
        <td class="td-head">联系人</td>
        <td colspan="2"><span>{{ detailInfo.contactsName }}</span></td>
        <td>联系电话</td>
        <td colspan="2"><span>{{ detailInfo.contactsPhone }}</span></td>
        <td>手机号码</td>
        <td colspan="2"><span>{{ detailInfo.contactsTelephone }}</span></td>
      </tr>
      <tr>
        <td class="td-head">网站地址</td>
        <td colspan="3"><span>{{ detailInfo.websiteAddress }}</span></td>
        <td>电子邮箱</td>
        <td colspan="3"><span>{{ detailInfo.email }}</span></td>
      </tr>
      <tr>
        <td class="td-head" rowspan="2">法定代表人</td>
        <td>姓名</td>
        <td><span>{{ detailInfo.legalRepresentativeName }}</span></td>
        <td>性别</td>
        <td><span>{{ ['男', '女'][detailInfo.legalRepresentativeSex - 1] }}</span></td>
        <td>出生日期</td>
        <td colspan="2"><span>{{ detailInfo.legalRepresentativeBirthday }}</span></td>
      </tr>
      <tr>
        <td>电话</td>
        <td colspan="2"><span>{{ detailInfo.legalRepresentativeTelephone }}</span></td>
        <td>联系电话</td>
        <td colspan="3"><span>{{ detailInfo.legalRepresentativePhone }}</span></td>
      </tr>
      <tr>
        <td class="td-head" rowspan="9">理（董）事会、监事会及行政负责人</td>
        <td>是否设立监事会</td>
        <td colspan="6"><span>{{ yesNoBool(detailInfo.supervisory) }}</span></td>
      </tr>
      <tr>
        <td>理事人数</td>
        <td colspan="2"><span>{{ detailInfo.directorPeopleNum }}人</span></td>
        <td>监事（会）人数</td>
        <td colspan="2"><span>{{ detailInfo.supervisoryPeopleNum }}人</span></td>
        <td>理事人数及监事（会）人数根据第5页填写自动计算</td>
      </tr>
      <tr>
        <td rowspan="4">理（董） 事长</td>
        <td>姓名</td>
        <td><span>{{ detailInfo.chairmanName }}</span></td>
        <td>性别</td>
        <td><span>{{ ['男', '女'][detailInfo.chairmanSex - 1] }}</span></td>
        <td>出生日期</td>
        <td><span>{{ detailInfo.chairmanBirthday }}</span></td>
      </tr>
      <tr>
        <td>政治面貌</td>
        <td><span>{{ dictToVal(dict4, detailInfo.chairmanPolitics) }}</span></td>
        <td>学历</td>
        <td><span>{{ dictToVal(dict5,detailInfo.chairmanQualification) }}</span></td>
        <td>是否专职</td>
        <td colspan="2"><span>{{ yesNoBool(detailInfo.chairmanFullTime) }}</span></td>
      </tr>
      <tr>
        <td colspan="2">工作单位及职务</td>
        <td colspan="6"><span>{{ detailInfo.chairmanDirectorUnitPosition }}</span></td>
      </tr>
      <tr>
        <td>电话</td>
        <td colspan="3"><span>{{ detailInfo.chairmanPhone }}</span></td>
        <td>移动电话</td>
        <td colspan="3"><span>{{ detailInfo.chairmanTelephone }}</span></td>
      </tr>
      <tr>
        <td rowspan="3">行政负责人</td>
        <td>姓名</td>
        <td><span>{{ detailInfo.responsibleName }}</span></td>
        <td>性别</td>
        <td><span>{{ ['男', '女'][detailInfo.responsibleSex - 1] }}</span></td>
        <td>出生日期</td>
        <td><span>{{ detailInfo.responsibleBirthday }}</span></td>
      </tr>
      <tr>
        <td>政治面貌</td>
        <td><span>{{ dictToVal(dict4, detailInfo.responsiblePolitics) }}</span></td>
        <td>学历</td>
        <td><span>{{ dictToVal(dict5, detailInfo.responsibleQualification) }}</span></td>
        <td>是否专职</td>
        <td colspan="2"><span>{{ yesNoBool(detailInfo.responsibleFullTime) }}</span></td>
      </tr>
      <tr>
        <td>电话</td>
        <td><span>{{ detailInfo.responsiblePhone }}</span></td>
        <td>QQ</td>
        <td><span>{{ detailInfo.responsibleQQ }}</span></td>
        <td>移动电话</td>
        <td colspan="2"><span>{{ detailInfo.responsibleTelephone }}</span></td>
      </tr>
    </table>
    <div class="msg-tip">
      <p>
        注：
      <p>1.理事人数为3-25人；</p>
      <p>2.若设监事会，监事人数至少为3人；</p>
      </p>
    </div>
  </div>
</template>

<script setup lang="ts">
import TbTitle from '@/views/yearCheck/components/TbTitle.vue'
import { reactive, ref, inject, getCurrentInstance } from 'vue'
import { usePageInfo } from "@/views/yearCheck/hooks/usePageInfo"
const { proxy } = getCurrentInstance();
const yesNoBool = proxy.$yesNoBool
// const { getDetailInfo } = usePageInfo()
let detailInfo = reactive({})
const { getDetailInfo } = inject('getDetailInfo')
const dict1 = ref([])
const dict2 = ref([])
const dict3 = ref([])
const dict4 = ref([])
const dict5 = ref([])


import { getDictNature, getDictAbode, getDictCounty, getDictPolitics, getDictXueli } from '@/api/dict/index'

let getDictInfo = () => {
  //单位性质
  getDictNature().then(res => {
    dict1.value = res.data
  })
  //住所来源
  getDictAbode().then(res => {
    dict2.value = res.data
  })
  //住所所在区县
  getDictCounty().then(res => {
    dict3.value = res.data
  })
  //政治面貌
  getDictPolitics().then(res => {
    dict4.value = res.data
  })
  //学历
  getDictXueli().then(res => {
    dict5.value = res.data
  })
}

getDictInfo()

getDetailInfo(1).then(res => {
  Object.assign(detailInfo, res.data)
})

const dictToVal = (dictList, val) => {
  for (let i = 0; i < dictList.length; i++) {
    if (val == dictList[i].id) {
      return dictList[i].name
    }
  }
}

</script>
<style lang="scss" scoped>
.msg-tip {
  padding: 20px 0;
  color: #000;
  font-family: '微软雅黑';
}
</style>
